package dams

import (
	"goPlay/cache"
	"goPlay/logger"
	"time"
)

var sc *cache.Cache

func Register() {
	logger.Info("Register Base Data")
	defaultExpiration, _ := time.ParseDuration("48h")
	gcInterval, _ := time.ParseDuration("1h")
	sc = cache.NewCache(defaultExpiration, gcInterval, "sc")
}

func UpdateCache(cac *cache.Cache, key string, value interface{}) {
	var item cache.Item
	item.Object = value
	item.Expiration = 0
	cac.Set(key, &item)
}
